//
//  AFNRequestManager.h
//  QianLongZan
//
//  Created by 陈家将 on 16/9/20.
//  Copyright © 2016年 szteyou. All rights reserved.
//

#import <Foundation/Foundation.h>

typedef void(^AFNSuccessBlock)(id _Nullable response, NSInteger resposeCode);
typedef void(^AFNFailureBlock)(NSError * _Nullable error, NSString *_Nullable errorMsg);

@class AFNBaseModel;

@interface AFNRequestManager : NSObject

+ (NSURLSessionDataTask *_Nonnull)GET:(NSString * _Nonnull)url parameter:(AFNBaseModel *_Nullable)baseModel success:(_Nullable AFNSuccessBlock)success failure:(_Nullable AFNFailureBlock)failure;
+ (NSURLSessionDataTask *_Nonnull)POST:(NSString *_Nonnull)url parameter:(AFNBaseModel *_Nullable)baseModel success:(_Nullable AFNSuccessBlock)success failure:(_Nullable AFNFailureBlock)failure;

// 新 参数不用转JSON和base64
+ (NSURLSessionDataTask *_Nonnull)POSTNew:(NSString *_Nonnull)url parameter:(AFNBaseModel *_Nullable)baseModel success:(_Nullable AFNSuccessBlock)success failure:(_Nullable AFNFailureBlock)failure;
+ (NSURLSessionDataTask *_Nonnull)GETNew:(NSString *_Nonnull)url parameter:(AFNBaseModel *_Nullable)baseModel success:(_Nullable AFNSuccessBlock)success failure:(_Nullable AFNFailureBlock)failure;
// 带数据的请求
+ (NSURLSessionDataTask *_Nonnull)POST:(NSString *_Nonnull)url constructingBodyWithBlock:(nullable void (^)(id <AFMultipartFormData> _Nullable formData))bodyBlock parameter:(AFNBaseModel *_Nullable)baseModel success:(_Nullable AFNSuccessBlock)success failure:(_Nullable AFNFailureBlock)failure;


@end
